public class Example12_1{
public static void main(String args[]){
		SpeakElephant speakElephant;
		SpeakCar speakCar;
		SpeakDog speakDog;
		speakElephant=new SpeakElephant();
		speakCar= new SpeakCar();
		speakDog= new SpeakDog();
		speakElephant.start();
		speakCar.start();
		speakDog.start();
		for(int i=1;i<=15;i++){
		System.out.print("主人"+i+" ");
		}
	}
}



public class SpeakDog extends Thread{
public void run(){
for(int i=1;i<=20;i++){
System.out.print("DOG"+i+" ");
		}
	}
} 